package com.free.ext.shiro.token;

import org.apache.shiro.authc.UsernamePasswordToken;

import java.util.Arrays;

/**
 * <p>
 * 功能概述:
 * </p>
 * <p>
 * 功能详述:
 * </p>
 */
public class CapatchaUserPwdToken extends UsernamePasswordToken {
    /*========================================================================*
     *                         Public Fields (公共属性)
     *========================================================================*/

    /*========================================================================*
     *                         Private Fields (私有属性)
     *========================================================================*/

    private static final long serialVersionUID = 4142705750978456562L;

    /**
     * 用来存放图形验证码
     */
    private String capatcha;

    /*========================================================================*
     *                         Construct Methods (构造方法)
     *========================================================================*/

    public CapatchaUserPwdToken(String capatcha, String username, String password)
    {
        super(username, password);
        this.capatcha = capatcha;
    }

    public CapatchaUserPwdToken(String capatcha, String username, String password, String host, boolean rememberMe)
    {
        super(username, password,  rememberMe, host);
        this.capatcha = capatcha;
    }

    /*========================================================================*
     *                         Public Methods (公有方法)
     *========================================================================*/
    public String getCapatcha()
    {
        return capatcha;
    }

    public void setCapatcha(String capatcha)
    {
        this.capatcha = capatcha;
    }

    @Override
    public String toString()
    {
        return "CaptchaUsernamePasswordToken [capatcha=" + capatcha + ", username=" + getUsername() + ", password="
                + Arrays.toString(getPassword()) + ", host=" + getHost() + ", isRememberMe=" + isRememberMe() + "]";
    }
    /*========================================================================*
     *                         Private Methods (私有方法)
     *========================================================================*/
}
